<script type="text/javascript">
    function win1() {
        window.open("<?php echo base_url().'index.php/skim/update/'.$skim_info['SKIM_ID'] ?>","Update SKIM","location=no,menubar=no,toolbar=no,width=436,height=360");
    }
    function win2() {
        window.open("<?php echo base_url().'index.php/skim/add_syarat/'.$skim_info['SKIM_ID']; ?>","Syarat SKIM Baru","location=no,menubar=no,toolbar=no,width=520,height=160")
    }
    function win3() {
        window.open("<?php echo base_url().'index.php/skim/add_pengumuman/'.$skim_info['SKIM_ID']; ?>","Pengumuman SKIM Baru","location=no,menubar=no,toolbar=no,width=590,height=210")
    }
</script>
<div class="kontent_box">
    <div class="kontent_panel">
    <div class="reg_input">
        <div><h3>Daftar Skim</h3></div>
        <div>
            <table>
                <tr>
                    <td>NAMA PROGRAM</td>
                    <td><?php echo $skim_info['PROGRAM_NAMA']; ?></td>
                </tr>
                <tr>
                    <td>KODE SKIM</td>
                    <td><?php echo $skim_info['SKIM_KODE']; ?></td>                
                </tr>
                <tr>
                    <td>NAMA SKIM</td>
                    <td><?php echo $skim_info['SKIM_NAMA']; ?></td>                
                </tr>
                <tr>
                    <td>DANA MAKSIMUM</td>
                    <td><?php echo $skim_info['SKIM_MAX_DANA']; ?></td>                
                </tr>
                <tr>
                    <td>JUMLAH ANGGOTA MAKSIMUM</td>
                    <td><?php echo $skim_info['SKIM_MAX_ANGGOTA']; ?></td>                
                </tr>
                <tr>
                    <td>JUMLAH PENELITIAN</td>
                    <td><?php echo count($penelitian_list); ?></td>                
                </tr>
                <tr>
                    <td>BIDANG PENELITIAN</td>
                    <td>
                        <?php $pertamax = 0; foreach ($bid_pen_skim_list as $row) { ?>
                        <?php if($pertamax == 0)$pertamax = 1; else echo ','; ?>
                        <?php echo $row['BIDANG_PEN_NAMA']; ?>
                        <?php } ?>
                    </td>                
                </tr>
                <tr>
                    <td>FILE PANDUAN</td>
                    <td>
                        <?php if($skim_info['SKIM_PANDUAN_PATH'] && $skim_info['SKIM_PANDUAN_PATH'] !== null) { ?>
                        <a href="<?php echo base_url().'static/docs/skim/'.$skim_info['SKIM_PANDUAN_PATH']; ?>" target="_blank">Lihat</a>
                        <?php }else{ ?>
                        <i>File Panduan tidak tersedia</i>
                        <?php } ?>
                    </td>                                
                </tr>
                <tr>
                    <td><a href="javascript:win1()">Edit Informasi</a></td>
                </tr>
            </table>
        </div>
        
        <div>
            <b>Syarat Skim</b><br />
            <?php if(count($persyaratan_skim_list) <= 0)echo '<i>skim ini belum memiliki syarat</i><br />'; ?>
            <table border = "1">
                <?php $counter = 1; ?>
                <?php foreach($persyaratan_skim_list as $row) { ?>
                <tr>
                    <td><?php echo $counter; ?></td>
                    <td><?php echo $row['SYARAT_DESKRIPSI']; ?></td>
                    <td><a href="<?php echo base_url().'index.php/skim/delete_syarat/'.$skim_info['SKIM_ID'].'/'.$row['SYARAT_ID'] ?>">DELETE</a></td>
                </tr>
                <?php $counter++; } ?>
            </table>
            <a href="javascript:win2()">Tambah Syarat</a>
        </div>
        <div>
            <b>Pengumuman Skim</b><br />
            <?php if(count($pengumuman_skim_list) <= 0)echo '<i>skim ini belum memiliki pengumuman</i><br />'; ?>
            <table border = "1">
                <?php $counter = 1; ?>
                <?php foreach($pengumuman_skim_list as $row) { ?>
                <tr>
                    <td><?php echo $counter; ?></td>
                    <td><b><?php echo $row['PENGUMUMAN_JUDUL']; ?></b></td>
                    <td><?php echo $row['PENGUMUMAN_DESKRIPSI']; ?></td>
                    <td><?php echo $row['PENGUMUMAN_TANGGAL']; ?></td>
                </tr>
                <?php $counter++; } ?>
            </table>
            <a href="javascript:win3()">Tambah Pengumuman</a>
        </div>
    </div>
</div>